#!/bin/bash
CURRENT_PATH=$PWD
cd $CURRENT_PATH/lib/tools
rpm -ivh *.rpm  --force
cd $CURRENT_PATH/lib/mongodb
rpm -ivh *.rpm  --force
cd $CURRENT_PATH/lib/redis
rpm -ivh *.rpm  --force
cd $CURRENT_PATH/lib/nginx
rpm -ivh *.rpm  --force
cd $CURRENT_PATH
rm data -rf
rm temp -rf
mkdir temp
touch temp/minio.log
touch temp/mongodb.log
touch temp/redis.log
touch temp/dgraph_zero.log
touch temp/dgraph.log
touch temp/drive.log
touch temp/editor.log
touch temp/convert.log
touch temp/editor_app.log
mkdir data
mkdir data/dgraph
mkdir data/dgraph/w
mkdir data/dgraph/p
mkdir data/dgraph/zw
mkdir data/minio
mkdir data/mongodb
chmod +x service/dgraph/dgraph
chmod +x service/dgraph/dgraph.sh
chmod +x service/dgraph/dgraph_zero.sh
chmod +x service/minio/minio.sh
chmod +x service/mongodb/mongo.sh
chmod +x service/redis/redis.sh
chmod +x bin/tools
chmod +x bin/editor_app
chmod +x bin/convert
chmod +x bin/main
chmod +x bin/drive
bash initNginx.sh
